package top.infopub.mgr.mkt.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import top.infopub.generic.GenericDao;
import top.infopub.generic.GenericServiceImpl;
import top.infopub.mgr.mkt.dao.StandardSubDao;
import top.infopub.mgr.mkt.service.StandardSubService;
import top.infopub.model.mkt.StandardSub;

@Service
public class StandardSubServiceImpl extends GenericServiceImpl<StandardSub, String> implements StandardSubService {

	@Autowired
	private StandardSubDao standardSubDao;

	@Override
	public GenericDao<StandardSub, String> getDao() {
		return standardSubDao;
	}

	@Override
	public Page<StandardSub> selectPageByDomainWhere(Page<StandardSub> page, StandardSub StandardSub) {
		PageHelper.startPage(page.getPageNum(), page.getPageSize());
		return (Page<StandardSub>) standardSubDao.selectByDomainWhere(StandardSub);
	}

	@Override
	public void addStandardSub(StandardSub StandardSub) {
		standardSubDao.insertSelective(StandardSub);
	}

	@Override
	public void editStandardSub(StandardSub StandardSub) {
		standardSubDao.updateByIdSelective(StandardSub);
	}

	@Override
	public List<StandardSub> selectByLineId(String baseLineId) {
		return standardSubDao.selectByLineId(baseLineId);
	}

	@Override
	public void insertByBatch(List<StandardSub> standardSubs) {
		standardSubDao.insertByBatch(standardSubs);
	}

	@Override
	public void deleteByBaseLineId(String baseLineId) {
		standardSubDao.deleteByBaseLineId(baseLineId);
	}

}
